package cn.wolfcode.mapper;

import cn.wolfcode.domain.Employee;
import cn.wolfcode.domain.Role;
import cn.wolfcode.qo.QueryObject;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface EmployeeMapper {
    int deleteByPrimaryKey(Long id);

    int deleteByEmployee(Long id);

    int insert(Employee record);

    int insertRole(@Param("e_id") Long e_id, @Param("r_id") Long r_id);

    Employee selectByPrimaryKey(Long id);

    Employee selectCheckName(String name);

    List<Employee> selectAll();

    int updateByPrimaryKey(Employee record);

    int queryForCount(QueryObject qo);

    List<Employee> queryForList(QueryObject qo);

    Employee login(@Param("username") String username, @Param("password") String password);

    List<String> selectExpression(Long id);
    List<String> selectSns(Long id);

    int updatePwd(Employee employee);

    void batchDelete(Long[] ids);

    void batchDeleteRole(Long[] ids);

    //根据id修改对应的status
    void updateStatus(Employee employee);

    //根据角色编码查询拥有该角色的员工
    List<Employee>  selectByRole(String...name);
}